package com.linln.modules.ticket.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linln.modules.ticket.domain.TicketLog;
import com.linln.modules.ticket.repository.TicketLogMapper;
import com.linln.modules.ticket.service.TicketLogService;

import java.util.List;

/**
 * @author : pengliang
 * @version V1.0
 * @Project: timo
 * @Package com.linln.modules.ticket.service.impl
 * @Descriptio /**
 * @Project: timo
 * @Package com.linln.modules.ticket.service.impl
 * @Description: TODO
 * @date Date : 2020年11月23日 17:21
 */

@Service
public class TicketLogServiceImpl extends ServiceImpl<TicketLogMapper, TicketLog> implements TicketLogService {

    @Autowired
    private TicketLogMapper ticketLogMapper;

    public TicketLog getOne(QueryWrapper<TicketLog> queryWrapper) {
        return super.getOne(queryWrapper);
    }

    @Override
    public Long getSameMonthVerificationCount(String shopId, String date) {
        return ticketLogMapper.selectSameMonthVerificationCount(shopId, date);
    }

    @Override
    public boolean addTicketLog(TicketLog ticketLog) {
        return super.save(ticketLog);
    }

    @Override
    public List<TicketLog> getCurrentMonthTicketLog(String ticketCode) {
        return ticketLogMapper.selectCurrentMonthTicketLog(ticketCode);
    }
}
